package com.zhonghui.modlules.shop.eshopDomain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eshop.domain.BaseDomain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@TableName("store_canvas")
public class StoreCanvas extends BaseDomain {
    @TableId
    private Long canvasId;
    @NotNull
    private Integer terminal;
    private String json;
    private Integer type;
    @NotBlank
    private String name;
    private Long shopId;

    public void copy(StoreCanvas source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }

    public StoreCanvas() {
    }

    public Long getCanvasId() {
        return this.canvasId;
    }

    public Integer getTerminal() {
        return this.terminal;
    }

    public String getJson() {
        return this.json;
    }

    public Integer getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public Long getShopId() {
        return this.shopId;
    }

    public void setCanvasId(final Long canvasId) {
        this.canvasId = canvasId;
    }

    public void setTerminal(final Integer terminal) {
        this.terminal = terminal;
    }

    public void setJson(final String json) {
        this.json = json;
    }

    public void setType(final Integer type) {
        this.type = type;
    }

    public void setName(final String name) {
        this.name = name;
    }

    public void setShopId(final Long shopId) {
        this.shopId = shopId;
    }

    public boolean equals(final Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof StoreCanvas)) {
            return false;
        } else {
            StoreCanvas other = (StoreCanvas)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$canvasId = this.getCanvasId();
                Object other$canvasId = other.getCanvasId();
                if (this$canvasId == null) {
                    if (other$canvasId != null) {
                        return false;
                    }
                } else if (!this$canvasId.equals(other$canvasId)) {
                    return false;
                }

                Object this$terminal = this.getTerminal();
                Object other$terminal = other.getTerminal();
                if (this$terminal == null) {
                    if (other$terminal != null) {
                        return false;
                    }
                } else if (!this$terminal.equals(other$terminal)) {
                    return false;
                }

                Object this$type = this.getType();
                Object other$type = other.getType();
                if (this$type == null) {
                    if (other$type != null) {
                        return false;
                    }
                } else if (!this$type.equals(other$type)) {
                    return false;
                }

                label62: {
                    Object this$shopId = this.getShopId();
                    Object other$shopId = other.getShopId();
                    if (this$shopId == null) {
                        if (other$shopId == null) {
                            break label62;
                        }
                    } else if (this$shopId.equals(other$shopId)) {
                        break label62;
                    }

                    return false;
                }

                label55: {
                    Object this$json = this.getJson();
                    Object other$json = other.getJson();
                    if (this$json == null) {
                        if (other$json == null) {
                            break label55;
                        }
                    } else if (this$json.equals(other$json)) {
                        break label55;
                    }

                    return false;
                }

                Object this$name = this.getName();
                Object other$name = other.getName();
                if (this$name == null) {
                    if (other$name != null) {
                        return false;
                    }
                } else if (!this$name.equals(other$name)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(final Object other) {
        return other instanceof StoreCanvas;
    }

    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $canvasId = this.getCanvasId();
        result = result * 59 + ($canvasId == null ? 43 : $canvasId.hashCode());
        Object $terminal = this.getTerminal();
        result = result * 59 + ($terminal == null ? 43 : $terminal.hashCode());
        Object $type = this.getType();
        result = result * 59 + ($type == null ? 43 : $type.hashCode());
        Object $shopId = this.getShopId();
        result = result * 59 + ($shopId == null ? 43 : $shopId.hashCode());
        Object $json = this.getJson();
        result = result * 59 + ($json == null ? 43 : $json.hashCode());
        Object $name = this.getName();
        result = result * 59 + ($name == null ? 43 : $name.hashCode());
        return result;
    }

    public String toString() {
        return "StoreCanvas(canvasId=" + this.getCanvasId() + ", terminal=" + this.getTerminal() + ", json=" + this.getJson() + ", type=" + this.getType() + ", name=" + this.getName() + ", shopId=" + this.getShopId() + ")";
    }
}

